<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>05反向悬停效果</title>
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    body {
        background: #262626;
    }
    ul {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        display: flex;
        font-size: 16px;
    }
    ul li a::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #368;
        z-index: -1;
        overflow: hidden;
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.5s ease-in-out;
    }
    ul li a:hover::before {
        transform: scaleX(1);
        transform-origin: left;
    }
    ul li a {
        position: relative;
        display: block;
        width: 264px;
        height: 80px;
        line-height: 80px;
        text-align: center;
        text-decoration: none;
        border: 1px solid #000;
        border-right: none;
        color: #fff;
        font-family: sans-serif;
    }
    ul li:last-child {
        border-right: 1px solid #000;
    }

</style>
</head>
<body>
    <ul>
        <li><a href="#">It</a></li>
        <li><a href="#">Just</a></li>
        <li><a href="#">Comes</a></li>
        <li><a href="#">And</a></li>
        <li><a href="#">Goes</a></li>
    </ul>
</body>
</html>